]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Catch exception trying to create a preview of an unknown image type
authorSiegfried-Angel Gevatter Pujals <rainct@ubuntu.com>
Tue, 11 Aug 2009 23:30:58 +0000 (01:30 +0200)
committerSiegfried-Angel Gevatter Pujals <rainct@ubuntu.com>
Tue, 11 Aug 2009 23:30:58 +0000 (01:30 +0200)
js/ui/docDisplay.js

index a1cc71ccbd80bb6208e41320cd829f8e8ee0c754..d2d4fa305de4b539d650277a3f5a0055a2658e43 100644 (file)
@@ -72,8 +72,15 @@ DocDisplayItem.prototype = {
         if (this._docInfo.mimeType == null || this._docInfo.mimeType.indexOf("image/") != 0)
             return null;
 
-        return Shell.TextureCache.get_default().load_uri_sync(Shell.TextureCachePolicy.NONE,
-                                                              this._docInfo.uri, availableWidth, availableHeight);
+        try {
+            return Shell.TextureCache.get_default().load_uri_sync(Shell.TextureCachePolicy.NONE,
+                                                                  this._docInfo.uri, availableWidth, availableHeight);
+        } catch (e) {
+            // An exception will be raised when the image format isn't know
+            /* FIXME: http://bugzilla.gnome.org/show_bug.cgi?id=591480: should
+             *        only ignore GDK_PIXBUF_ERROR_UNKNOWN_TYPE. */
+            return null;
+        }
     },
 
     //// Private Methods ////